#ifndef _SCACHE_H_
#define _SCACHE_H_

#define SLOT_SIZE_MAX		1024	/* max size of slot */
#define SLAB_SIZE_DEF		1024	/* num/slab default */

#include "vla.h"

typedef struct scache{
	unsigned int slot_size;	//size of slot can't modify after new
	unsigned int slab_size;	//num/slab can't modify after new
	unsigned int sloti;	//cur slot
	unsigned int slabi;	//cur slab
	vla	*	slab_list;	//array of void *
} scache;

scache * scache_create(unsigned int size);
void * scache_alloc(scache *p);
int scache_clear(scache *p);
int scache_destroy(scache * p);

#endif
